{include file="public/header" /}
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-key"></span>编辑权限组 </strong></div>
  <div class="body-content">
    <form id="form" method="post" class="form-x" action="">
      <div class="form-group">

        <div class="form-group">
          <div class="label">
            <label for="sitename">权限组名：</label>
          </div>
          <div class="field">
            <label style="line-height:33px;">
              <input type="text" class="input w50" name="role_name" value="{$info.role_name}"  data-validate="required:权限组名不能为空" />
            </label>
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label for="sitename">级别：</label>
          </div>
          <div class="field">
            <label style="line-height:33px;">
              <textarea class="input" name="remark" style=" height:60px;">{$info.remark}</textarea>
            </label>
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label for="sitename">状态：</label>
          </div>
          <div class="field">
            <label style="line-height:33px;">
              <input type="radio" name="status" value="1" {if $info.status eq 1}checked{/if}> 启用 &nbsp;&nbsp;
              <input type="radio" name="status" value="0" {if $info.status eq 0}checked{/if}> 禁用
            </label>
          </div>
        </div>


        <div class="form-group">
          <div class="label">
            <label></label>
          </div>
          <div class="field">
            <input type="hidden" name="id" value="{$info.id}">
            <a class="button bg-main icon-check-square-o" onclick="submit()"> 编辑</a>
          </div>
        </div>
    </form>
  </div>
</div>
<script>
  function submit(){
    var data=new FormData($("#form")[0]);
    $.ajax({
      type:"post",
      url:"{:U('AdminRole/edit')}",
      data:data,
      dataType:"json",
      processData:false,
      contentType:false,
      cache:false,
      success:function(rs){
        if(rs.res==1 && rs.data.url!= undefined){
          layer.msg(rs.msg, {icon:1}, function(){
            window.location=rs.data.url;
          });
        }else{
          layer.msg(rs.msg);
        }
      }
    });
  }
</script>
{include file="public/footer" /}